package com.acs.player.views.playlist;

import java.util.ArrayList;
import java.util.List;

import android.app.LauncherActivity;

import com.acs.player.entities.Music;
import com.acs.player.entities.Playlist;

public class PlaylistUtils {

	private static PlaylistUtils instance;
	
	private static List<Playlist> playlists = new ArrayList<Playlist>();
	
	private PlaylistUtils(){};
	
	public static PlaylistUtils getPlaylistUtils(){
		if(instance == null){
			instance = new PlaylistUtils();
		}
		return instance;
	}

	public List<Playlist> getPlaylists() {
		return playlists;
	}

	public void setPlaylists(List<Playlist> playlists) {
		this.playlists = playlists;
	}
	
	public void addOnePlayList(Playlist playlist){
		playlists.add(playlist);

	}
		
	public void addMusicToPlaylist(Music music, int playlistIndex){
		Playlist playlist = playlists.get(playlistIndex);
		playlist.getMusicList().add(music);
		
		playlists.remove(playlistIndex);
		playlists.add(playlistIndex, playlist);
	}
}
